﻿using System;
using matrixdotnet.Common;
namespace matrixdotnet.CommonDAL
{
    public interface IDataEntityFactory<
        TIdentity, TUniqueKey, TBusinessEntity, TDataEntity, TDataEntityInterface, TLazyEntity>
        where TIdentity : struct
        where TUniqueKey : struct
        where TBusinessEntity : class, IBusinessEntity<TUniqueKey>
        where TDataEntityInterface : class, IDataEntity<TIdentity, TUniqueKey, TBusinessEntity>, TBusinessEntity
        where TDataEntity : class, TDataEntityInterface
        where TLazyEntity : LazyDataEntity<TIdentity, TUniqueKey, TBusinessEntity, TDataEntityInterface>, TBusinessEntity
    {
        TLazyEntity Create(TIdentity identity);
        TDataEntity Create(TBusinessEntity businessEntity);
        TDataEntity Create(TIdentity identity, TBusinessEntity businessEntity, long version);
    }

    public interface IDataEntityFactoryL<
        TUniqueKey, TBusinessEntity, TDataEntity, TDataEntityInterface, TLazyEntity> :
        IDataEntityFactory<long, TUniqueKey, TBusinessEntity, TDataEntity, TDataEntityInterface, TLazyEntity>
        where TUniqueKey : struct
        where TBusinessEntity : class, IBusinessEntity<TUniqueKey>
        where TDataEntityInterface : class, IDataEntity<long, TUniqueKey, TBusinessEntity>, TBusinessEntity
        where TDataEntity : class, TDataEntityInterface
        where TLazyEntity : LazyDataEntity<long, TUniqueKey, TBusinessEntity, TDataEntityInterface>, TBusinessEntity
    {
    }
}
